<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>二手商品总览</title>
    <meta charset="UTF-8"/>
    <link rel="stylesheet" type="text/css" href="/css/goods.css"/>
    <script type="text/javascript" src="/js/jquery-3.2.js"></script>
    <script type="text/javascript">
        $(function ()
        {
            $('.update_publish').click(function ()
            {
                var id = $(this).attr('value');
//                alert(id);
                window.location.href = '/modifiedPublishProduct.do?GID=' + id;
            });

            $('.delete_publish').click(function ()
            {
                var r = confirm("确定删除？？？？")
                if (r == true) {
                    var id = $(this).attr('value');
//                    alert(id);
                    window.location.href="/deleteGoods.do?GID="+id;
                }
            });
        });
    </script>

    <style>
        .update_publish{
            width: 40px;
            height: 36px;
            padding: 5px;
            margin-left:20px;
            text-decoration: none;
            color: white;
            font-size: 13px;
            border: 1px solid #4b4d52;
            border-radius: 2px;
            background: #4b4d52;
        }

        .update_publish:hover{
            /*font-weight: 600;*/
            background-color: #626a55;
            border: 1px solid #626a55;
            font-weight: 600;
        }

        .delete_publish{
            width: 40px;
            height: 36px;
            padding: 5px;
            margin-left:20px;
            text-decoration: none;
            color: white;
            font-size: 13px;
            border: 1px solid #4b4d52;
            border-radius: 2px;
            background: #4b4d52;
        }

        .delete_publish:hover{
            /*font-weight: 600;*/
            background-color: #626a55;
            border: 1px solid #626a55;
            font-weight: 600;
        }
    </style>

</head>
    <body>

    <!-- 导航 -->
    <header class="navbar">
        <div class="nav-info">
            <a href="/personal_info.do" th:text="${marketUser.uname}">用户</a>
            <a class="goodshelf" href="/goToMyCart.do">||&nbsp;&nbsp;&nbsp;我的购物车</a>
            <a class="logout" href="/logout.do">[ 退 出 ]</a>
        </div> <!-- nav-info -->
        <ul class="menu">
            <li><a href="/">首页</a></li>
        </ul>
    </header>

    <!-- 图书分类 -->
    <div id="container">
        <div id="goods-container">
            <h3 class="goods-title"><a href="#">| 我的二手商品</a></h3>
            <ul class="goods-lists">
                <figure class="goods-list" th:each="o:${marketGoodsList}">
                    <a href="#" class="goods-pic">
                        <!--						<img src="/img/1.jpg" th:src="${o.getGID()}"/>-->
                        <img src="/image/book.jpg"/>
                    </a>
                    <a href="#" class="goods-info">
                        <h5 class="goods-name" th:text="${o.getName()}">计算机组成原理</h5>
                        <span class="goods-detail" th:text="'种类:' + ${o.getKind()}+' | '+ '数量:' + ${o.getNumber()}"></span>
                        <!--						<span class="goods-detail" th:text="'数量'+${o.getNumber()}"></span>-->
                        <h5 class="goods-price" th:text="'￥'+${o.getPrice()}">999</h5>
                    </a>
                    <span>
                            <a href="#" class="update_publish" th:value="${o.getGID()}">修改商品信息</a>
                            <a href="#" class="delete_publish" th:value="${o.getGID()}">下架商品</a>
                    </span>
                </figure>
            </ul>
        </div>

        <span class="page-btn">
                    <a href="goods.html" class="page-top">首页</a>
                    <a href="#" class="page-pre">上一页</a>
                    <a href="#" class="page-next">下一页</a>
                    <a href="#" class="page-end">尾页</a>
                </span>

    </div>


    <footer>
        <a href="#">©2021-7 二手物品交易</a>
        <a href="#">意见反馈&nbsp;&nbsp;&nbsp;联系我们&nbsp;&nbsp;&nbsp;隐私权声明&nbsp;&nbsp;&nbsp;使用条款</a>
    </footer>

    </body>
</html>